//
//  ViewController.m
//  10505
//
//  Created by student on 16/2/19.
//  Copyright © 2016年 niit. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.

}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


- (IBAction)colorchanged:(UISlider *)sender
{
    self.redvalue.text = [NSString stringWithFormat:@"%.1f",self.redslide.value];
    self.greenvalue.text = [NSString stringWithFormat:@"%.1f",self.greenslide.value];
    self.bluevalue.text = [NSString stringWithFormat:@"%.1f",self.blueslide.value];

    NSLog(@"%f,%f,%f",self.redslide.value/255,self.greenslide.value/255,self.blueslide.value/255);
    self.colorview.backgroundColor = [UIColor colorWithRed:self.redslide.value/255 green:self.greenslide.value/255 blue:self.blueslide.value/255 alpha:1];
   
    
}
@end
